package com.trt.api.controller.admin;

import com.trt.pojo.dto.AdminLoginBO;
import com.trt.pojo.dto.AdminUserBO;
import com.trt.utils.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;

/**
 * @author tanrentao
 * @date 2021-12-03
 * @desc
 */
@Api(value = "管理员admin维护", tags = "管理员admin维护controller")
@RequestMapping("admin")
public interface AdminControllerApi {

    @ApiOperation(value = "管理员登录", notes = "管理员登录", httpMethod = "POST")
    @PostMapping("/adminUserLogin")
    public ApiResult adminUserLogin(@RequestBody AdminLoginBO adminLoginBO, BindingResult result, HttpServletResponse response);

    @ApiOperation(value = "查询admin用户名是否存在", notes = "查询admin用户名是否存在", httpMethod = "POST")
    @PostMapping("/adminUserIsExist")
    public ApiResult adminUserIsExist(@RequestParam String username);

    @ApiOperation(value = "创建admin用户", notes = "创建admin用户", httpMethod = "POST")
    @PostMapping("/addAdminUser")
    public ApiResult addAdminUser(@RequestBody AdminUserBO adminUserBO);

    @ApiOperation(value = "查询admin列表", notes = "查询admin列表", httpMethod = "POST")
    @PostMapping("/getAdminList")
    public ApiResult getAdminUserList(@ApiParam(name = "page", value = "查询下一页的第几页", required = false) @RequestParam Integer page,
                                      @ApiParam(name = "pageSize", value = "分页查询每一页显示的条数", required = false) @RequestParam Integer pageSize);

    @ApiOperation(value = "admin退出登录", notes = "admin退出登录", httpMethod = "POST")
    @PostMapping("/adminLogout")
    public ApiResult adminLogout(@RequestParam String adminUserId, HttpServletResponse response);


}
